#define _CRT_SECURE_NO_WARNINGS 1
#pragma warning(disable:6031)
#include<stdio.h>
#include<stdlib.h>

struct ListNode
{
    int val;
    struct ListNode* next;
};

void transform_List(struct ListNode** plist, int* arr, int sz)
{
    int i = 0;
    struct ListNode* head = (struct ListNode*)malloc(sizeof(struct ListNode));
    *plist = head;
    struct ListNode* tmp;
    head->val = arr[0];
    head->next = NULL;
    for (i = 1; i < sz; i++)
    {
        head->next = tmp = (struct ListNode*)malloc(sizeof(struct ListNode));
        tmp->val = arr[i];
        tmp->next = NULL;
        head = head->next;
    }
}


int main()
{
    struct ListNode* plist;
    int arr[] = { 6,2,8 };
    transform_List(&plist, arr, 3);

	return 0;
}
